let myname: string = "我是一个好学生";
const secname: string = "我是好学生";
//secname = "this is my";
let firnumber: number = 666;
firnumber = 999;
let sei: string = 'hello ${myname}';
let istrue: boolean = false;
function warnUser(): void {
	console.log("this is my warning message");
}
let undefi: undefined = undefined;
let nu: null = null;
let firnu: number[] = [1, 2, 3];
let strlength: number = firnu.length;
const wza: object = { "name": "wz", "age": 18, "sex": "man" };
function wzadd(x: number, y: number): number {
	return x + y;
}
wzadd(1, 2);
wzadd(1, "2");
let z: number = 10;
wzadd(1, 2, z);
function wadd(x: string, y: number) {
	return x + y;
}
wadd(1, 2);
wadd("1", 2);
function buildname(firstname: string, secname?: string) {
	return firstname + secname;
}
buildname("wz", "18");
buildname("wz");
buildname("wz", "18", "man");
function wzname(firstname: string, secname: string, thname?: string) {
	return firstname + secname + thname;
}
wzname("王", "喆");
wzname("mi", "mk", "fef");
function buildName(firstName: string, lastName = "Smith") {
	return firstName + " " + lastName;
}
buildName("wz", "w");
buildName("wz");
function build(firstName: string | number | boolean, ...restname: string[]) {
	return firstName + " " + restname.join(" ");
}
build("王", "喆", "wz", "wz");
build(4, "s");
build(false, "fs");
let wzname1 = build("Joseph", "Samuel", "Lucas", "MacKinzie");
function wzmyadd(x: string | number, y: string | number) {
	if (typeof x === 'number' && typeof y === 'number') {
		return x + y;
	}
	else {
		return x.toString() + y.toString();
	}
}
wzmyadd(1, 2);
wzmyadd("wz", 18);


